<div class="headbar">
	<div class="position"><span>插件</span><span>></span><span>插件管理</span><span>></span><span>插件列表</span></div>
</div>

<div class="content">
	<table class="list_table">
		<colgroup>
			<col width="220px">
			<col />
			<col width="130px">
			<col width="130px">
		</colgroup>

		<thead>
			<tr>
				<th>名称</th>
				<th>描述</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
			{foreach:items=plugin::getItems()}
			<tr>
				<td>{$item['name']}</td>
				<td>{$item['description']}</td>
				<td>
					<label class="{echo:$item['is_open'] == 1 ? 'green' : 'red'}">
						{echo:$item['is_open'] == 1 ? '使用中' : '已关闭'}
					</label>

					<label class="{echo:$item['is_install'] == 1 ? 'green' : 'red'}">
						【{echo:$item['is_install'] == 1 ? '已安装' : '未安装'}】
					</label>
				</td>
				<td>
					{if:$item['is_install'] == 1}
					<a href="{url:/plugins/plugin_edit/class_name/$item['class_name']}"><img class="operator" src='{skin:images/admin/icon_edit.gif}' alt='修改插件' title='修改插件' /></a>
					<a href="javascript:delModel({link:'{url:/plugins/plugin_del/class_name/$item['class_name']}'});"><img class="operator" src='{skin:images/admin/icon_del.gif}' alt='删除插件' title='删除插件' /></a>
					{else:}
					<a href="javascript:install('{$item['class_name']}');"><img class="operator" src='{skin:images/admin/icon_add.gif}' alt='添加插件' title='添加插件' /></a>
					{/if}
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>

<script type="text/javascript">
//安装插件提示
function install(class_name)
{
	var url = "{url:/plugins/plugin_add/class_name/@class_name@}";
	url     = url.replace("@class_name@",class_name);
	window.confirm("确定要安装此插件到系统么？","window.location.href='"+url+"'");
}
</script>